package ae.pcfc.cldos.online.common.clddb.domain;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.envers.AuditTable;
import org.hibernate.envers.Audited;

import ae.pcfc.cldos.online.common.domain.BaseEntity;


/**
 * The persistent class for the T_CLDOS_APPLICATION_ATTACHMENT database table.
 * 
 */
@Entity
@Table(name="T_CLDOS_APPLICATION_ATTACHMENT")
@Audited
@AuditTable(value="T_CLDOS_APP_ATTC_AUD")
@SequenceGenerator(name = "SQ_CLDOS_ATCHMNT_ID", sequenceName = "SQ_CLDOS_ATCHMNT_ID", initialValue = 1, allocationSize = 1)
public class ApplicationAttachment extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String ONLINE_ID = "onlineId";
	
	@Id
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator="SQ_CLDOS_ATCHMNT_ID")
	@Column(name="ATTACHMENT_ID")
	private Long attachmentId;

	@Column(name="ATTACHMENT_FILE_EXT")
	private String attachmentFileExt;

	@Column(name="ATTACHMENT_FILE_NAME")
	private String attachmentFileName;

	@Column(name="ATTACHMENT_PATH")
	private String attachmentPath;
	
	@Column(name="ONLINE_FILE_ID")
	private Long onlineId;

	@Column(name="MI_MSG_ID")
	private BigDecimal miMsgId;
	
	@Column(name="APPLICATION_ID")
	private Long appId;

	//bi-directional many-to-one association to AppMetaData
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="APPLICATION_ID", updatable=false, insertable=false)
	private AppMetaData AppMetaData;

	@Column(name="ATTACHMENT_TYPE_CODE")
	private String attachmentTypeCode;
	
	//bi-directional many-to-one association to AttachmentType
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ATTACHMENT_TYPE_CODE", insertable=false, updatable=false)
	private AttachmentType AttachmentType;

	//bi-directional many-to-one association to Process
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PROCESS_CODE")
	private Process Process;

	//bi-directional many-to-one association to ProcessStep
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PROCESS_STEP_CODE")
	private ProcessStep ProcessStep;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="MI_MSG_ID", insertable=false, updatable=false)
	private MessageInbox messageInbox;

    public ApplicationAttachment() {
    }

	public Long getAttachmentId() {
		return this.attachmentId;
	}

	public void setAttachmentId(Long attachmentId) {
		this.attachmentId = attachmentId;
	}

	public String getAttachmentFileExt() {
		return this.attachmentFileExt;
	}

	public void setAttachmentFileExt(String attachmentFileExt) {
		this.attachmentFileExt = attachmentFileExt;
	}

	public String getAttachmentFileName() {
		return this.attachmentFileName;
	}

	public void setAttachmentFileName(String attachmentFileName) {
		this.attachmentFileName = attachmentFileName;
	}

	public String getAttachmentPath() {
		return this.attachmentPath;
	}

	public void setAttachmentPath(String attachmentPath) {
		this.attachmentPath = attachmentPath;
	}

	public BigDecimal getMiMsgId() {
		return this.miMsgId;
	}

	public void setMiMsgId(BigDecimal miMsgId) {
		this.miMsgId = miMsgId;
	}

	public AppMetaData getAppMetaData() {
		return this.AppMetaData;
	}

	public void setAppMetaData(AppMetaData AppMetaData) {
		this.AppMetaData = AppMetaData;
	}
	
	public AttachmentType getAttachmentType() {
		return this.AttachmentType;
	}

	public void setAttachmentType(AttachmentType AttachmentType) {
		this.AttachmentType = AttachmentType;
	}
	
	public Process getProcess() {
		return this.Process;
	}

	public void setProcess(Process Process) {
		this.Process = Process;
	}
	
	public ProcessStep getProcessStep() {
		return this.ProcessStep;
	}

	public void setProcessStep(ProcessStep ProcessStep) {
		this.ProcessStep = ProcessStep;
	}

	public MessageInbox getMessageInbox() {
		return messageInbox;
	}

	public void setMessageInbox(MessageInbox messageInbox) {
		this.messageInbox = messageInbox;
	}

	public Long getOnlineId() {
		return onlineId;
	}

	public void setOnlineId(Long onlineId) {
		this.onlineId = onlineId;
	}

	public Long getAppId() {
		return appId;
	}

	public void setAppId(Long appId) {
		this.appId = appId;
	}

	public String getAttachmentTypeCode() {
		return attachmentTypeCode;
	}

	public void setAttachmentTypeCode(String attachmentTypeCode) {
		this.attachmentTypeCode = attachmentTypeCode;
	}
	
}